#ifndef SHIJU_ZHONGDUN_XA_MSG_DEF_H
#define SHIJU_ZHONGDUN_XA_MSG_DEF_H
#include <stdint.h>
#include <vector>

#define MSG_START_REQ_TYPE_CODE (0xA1)
#define MSG_START_ACK_TYPE_CODE (0xA2)
#define MSG_CONFIG_REPORT_REQ_TYPE_CODE (0xA3)
#define MSG_CONFIG_REPORT_ACK_TYPE_CODE (0xA4)
#define MSG_SET_DATETIME_REQ_TYPE_CODE (0xA5)
#define MSG_SET_DATETIME_ACK_TYPE_CODE (0xA6)
#define MSG_SET_BTS_REQ_TYPE_CODE (0xA7)
#define MSG_SET_BTS_ACK_TYPE_CODE (0xA8)
#define MSG_USER_REPORT_REQ_TYPE_CODE (0xA9)
#define MSG_GET_HISTORY_REQ_TYPE_CODE (0xAA)
#define MSG_GET_HISTORY_ACK_TYPE_CODE (0xAB)
#define MSG_HEARTBEAT_REQ_TYPE_CODE (0xAC)
#define MSG_WARNING_REQ_TYPE_CODE (0xAD)
#define MSG_RESET_REQ_TYPE_CODE (0xAE)
#define MSG_RESET_ACK_TYPE_CODE (0xAF)
#define MSG_SET_CONTROL_REQ_TYPE_CODE (0xD1)
#define MSG_SET_CONTROL_ACK_TYPE_CODE (0xD2)
#define MSG_CONTROL_OPTION_REQ_TYPE_CODE (0xD3)
#define MSG_CONTROL_OPTION_ACK_TYPE_CODE (0xD4)
#define MSG_RSSI_REPORT_REQ_TYPE_CODE (0xD5)
#define MSG_SMS_RECV_REQ_TYPE_CODE (0xD6)
#define MSG_CALL_RECV_REQ_TYPE_CODE (0xD7)
#define MSG_GET_VERSION_TYPE_CODE (0xB5)
#define MSG_GET_VERSION_ACK_TYPE_CODE (0xB6)
#define MSG_SEND_PACKET_TYPE_CODE (0xB7)
#define MSG_SEND_PACKET_ACK_TYPE_CODE (0xB8)
#define MSG_DOWNLOAD_END_TYPE_CODE (0xB9)
#define MSG_GET_HISTORY_INFOMATION_REQ_TYPE_CODE (0xC0)
#define MSG_GET_HISTORY_INFOMATION_ACK_TYPE_CODE (0xC1)
#define MSG_SEND_RECORD_SELECT_TYPE_CODE (0xE0)
#define MSG_SEND_RECORD_SELECT_ACK_TYPE_CODE (0xE1)
#define MSG_SEND_RECORD_REQ_TYPE_CODE (0xE2)
#define MSG_SEND_RECORD_ACK_TYPE_CODE (0xE3)
#define MSG_SEND_RECORD_END_TYPE_CODE (0xE4)
#define MSG_GET_BTS_INFO_REQ_TYPE_CODE (0xC2)
#define MSG_GET_BTS_INFO_ACK_TYPE_CODE (0xC3)
#define MSG_GET_TIME_REQ_TYPE_CODE (0xC4)
#define MSG_GET_TIME_ACK_TYPE_CODE (0xC5)
#define MSG_DELETE_USERDATA_REQ_TYPE_CODE (0xD8)
#define MSG_DELETE_USERDATA_ACK_TYPE_CODE (0xD9)
#define MSG_RF_POWER_REQ_TYPE_CODE (0xDC)
#define MSG_RF_POWER_ACK_TYPE_CODE (0xDD)
#define MSG_SCAN_REQ_TYPE_CODE (0xE5)
#define MSG_SCAN_ACK_TYPE_CODE (0xE6)
#define MSG_XML_SCAN_ACK_TYPE_CODE (0xEE)
#define MSG_GPSINFO_REQ_TYPE_CODE (0xEF)
typedef struct TagSendRecord
{
    int seqNum;
    int uptime;
    char imsi[8];
    char imei[8];
    char tmsi[4];
    uint16_t lac;
    uint32_t equipmentId;
} SendRecord;


class MSG_START_REQ
{
public:
    MSG_START_REQ();

    uint32_t equipmentId_;
    uint16_t version_;
    char date_[25] ;
};

class MSG_START_ACK
{
public:
    MSG_START_ACK();

    int8_t result_;
};

class MSG_CONFIG_REPORT_REQ
{
public:
    MSG_CONFIG_REPORT_REQ();

    uint32_t equipmentId_;
    uint32_t frequency_;
    int8_t power_;
};

class MSG_CONFIG_REPORT_ACK
{
public:
    MSG_CONFIG_REPORT_ACK();

    int8_t result_;
};

class MSG_SET_DATETIME_REQ
{
public:
    MSG_SET_DATETIME_REQ();

    char date_[8] ;
    char time_[6] ;
};

class MSG_SET_DATETIME_ACK
{
public:
    MSG_SET_DATETIME_ACK();

    int8_t result_;
};

class MSG_SET_BTS_REQ
{
public:
    MSG_SET_BTS_REQ();

    uint32_t frequency_;
    int8_t power_;
    uint32_t rac_;
    uint32_t lacUpdateCircle_;
};

class MSG_SET_BTS_ACK
{
public:
    MSG_SET_BTS_ACK();

    int8_t result_;
};

class MSG_USER_REPORT_REQ
{
public:
    MSG_USER_REPORT_REQ();

    uint32_t sequenceNumber_;
    uint32_t timestamp_;
    char imsi_[8] ;
    char imei_[8] ;
    uint32_t tmsi_;
    uint16_t lac_;
    uint32_t equipmentID_;
};

class MSG_GET_HISTORY_REQ
{
public:
    MSG_GET_HISTORY_REQ();

    char dateTime_[8] ;
    uint32_t sequenceNumber_;
};

class MSG_GET_HISTORY_ACK
{
public:
    MSG_GET_HISTORY_ACK();

    int8_t result_;
    uint32_t sequenceNumber_;
    uint32_t timestamp_;
    char imsi_[8] ;
    char imei_[8] ;
    uint32_t tmsi_;
    uint16_t lac_;
    uint32_t equipmentID_;
};

class MSG_HEARTBEAT_REQ
{
public:
    MSG_HEARTBEAT_REQ();

    uint32_t btsid_;
};

class MSG_WARNING_REQ
{
public:
    MSG_WARNING_REQ();

    int8_t warningType_;
};

class MSG_RESET_REQ
{
public:
    MSG_RESET_REQ();

};

class MSG_RESET_ACK
{
public:
    MSG_RESET_ACK();

};

class MSG_SET_CONTROL_REQ
{
public:
    MSG_SET_CONTROL_REQ();

    int8_t mode_;
    uint16_t count_;
    uint16_t number_;
    int8_t locateType_;
    char imsiOrImei_[8] ;
};

class MSG_SET_CONTROL_ACK
{
public:
    MSG_SET_CONTROL_ACK();

    int8_t mode_;
    int8_t result_;
};

class MSG_CONTROL_OPTION_REQ
{
public:
    MSG_CONTROL_OPTION_REQ();

    int8_t mode_;
    int8_t submode_;
    int8_t locateType_;
    char imsiOrImei[8] ;
    char moNumber_[23] ;
    char info_[140] ;
};

class MSG_CONTROL_OPTION_ACK
{
public:
    MSG_CONTROL_OPTION_ACK();

    int8_t mode_;
    int8_t subMode_;
    int8_t result_;
};

class MSG_RSSI_REPORT_REQ
{
public:
    MSG_RSSI_REPORT_REQ();

    uint32_t timeStamp_;
    char imsi_[8] ;
    char imei_[8] ;
    uint32_t equipment_;
    int8_t rssi_;
};

class MSG_SMS_RECV_REQ
{
public:
    MSG_SMS_RECV_REQ();

    uint32_t timeStamp_;
    char imsi_[8] ;
    char imei_[8] ;
    char number_[23] ;
    char content_[128] ;
};

class MSG_CALL_RECV_REQ
{
public:
    MSG_CALL_RECV_REQ();

    uint32_t timeStamp_;
    char imsi_[8] ;
    char imei_[8] ;
    char number_[23] ;
};

class MSG_GET_VERSION
{
public:
    MSG_GET_VERSION();

};

class MSG_GET_VERSION_ACK
{
public:
    MSG_GET_VERSION_ACK();

    char version_[2] ;
    char date_[25] ;
};

class MSG_SEND_PACKET
{
public:
    MSG_SEND_PACKET();

    uint16_t sn_;
    uint8_t length_;
    char data_[237] ;
    char crc_[40] ;
};

class MSG_SEND_PACKET_ACK
{
public:
    MSG_SEND_PACKET_ACK();

    int8_t result_;
};

class MSG_DOWNLOAD_END
{
public:
    MSG_DOWNLOAD_END();

};

class MSG_GET_HISTORY_INFOMATION_REQ
{
public:
    MSG_GET_HISTORY_INFOMATION_REQ();

};

class HISTORY_INFO_RECORD
{
public:
    HISTORY_INFO_RECORD();
    HISTORY_INFO_RECORD(char *date, uint32_t seqNum);
 


    char dataTime_[8] ;
    uint32_t sequence_;
};

class MSG_GET_HISTORY_INFOMATION_ACK
{
public:
    MSG_GET_HISTORY_INFOMATION_ACK();

    std::vector<HISTORY_INFO_RECORD> hisInfoRecords_;
};

class MSG_SEND_RECORD_SELECT
{
public:
    MSG_SEND_RECORD_SELECT();

    char date_[8] ;
};

class MSG_SEND_RECORD_SELECT_ACK
{
public:
    MSG_SEND_RECORD_SELECT_ACK();

    int8_t result_;
    uint32_t fileSize_;
};

class MSG_SEND_RECORD_REQ
{
public:
    MSG_SEND_RECORD_REQ();

    uint16_t sn_;
};

class MSG_SEND_RECORD_ACK
{
public:
    MSG_SEND_RECORD_ACK();

    uint16_t sn_;
    int8_t num_;
    char data_[3400] ;
    char crc_[40] ;
};

class MSG_SEND_RECORD_END
{
public:
    MSG_SEND_RECORD_END();

};

class MSG_GET_BTS_INFO_REQ
{
public:
    MSG_GET_BTS_INFO_REQ();

};

class MSG_GET_BTS_INFO_ACK
{
public:
    MSG_GET_BTS_INFO_ACK();

    uint32_t arfcn_;
    int8_t power_;
    int32_t rac_;
    uint32_t luc_;
};

class MSG_GET_TIME_REQ
{
public:
    MSG_GET_TIME_REQ();

};

class MSG_GET_TIME_ACK
{
public:
    MSG_GET_TIME_ACK();

    uint32_t timeStame_;
};

class MSG_DELETE_USERDATA_REQ
{
public:
    MSG_DELETE_USERDATA_REQ();

};

class MSG_DELETE_USERDATA_ACK
{
public:
    MSG_DELETE_USERDATA_ACK();

    int8_t result_;
};

class MSG_RF_POWER_REQ
{
public:
    MSG_RF_POWER_REQ();

    int8_t onOfOff_;
};

class MSG_RF_POWER_ACK
{
public:
    MSG_RF_POWER_ACK();

};

class MSG_SCAN_REQ
{
public:
    MSG_SCAN_REQ();

    uint32_t equipmentId_;
    int8_t operatorsId_;
};

class SCAN_NEIGH_INFO
{
public:
    SCAN_NEIGH_INFO();
    uint32_t neighbourFrequency_;
};

class SCAN_BEST_FREQ_INFO
{
public:
    SCAN_BEST_FREQ_INFO();


    uint32_t bestFrequency_;
};

class MSG_SCAN_ACK
{
public:
    MSG_SCAN_ACK();
    uint32_t equipmentId_;
    uint8_t bestFrequencyTotle_;
    uint8_t neighbourFrequencyTotle_;
    SCAN_NEIGH_INFO neighInfo_[6] ;
    SCAN_BEST_FREQ_INFO bestFreqInfo_[6] ;
};

class XML_SCAN_BCCH_INFO
{
public:
    XML_SCAN_BCCH_INFO();

    uint16_t frequency_;
    int8_t rssi_;
    uint8_t agent_;
    uint8_t nebFreqTotle_;
    uint16_t nebFreq_[96] ;
};

class MSG_XML_SCAN_ACK
{
public:
    MSG_XML_SCAN_ACK();

    uint32_t equipmentID1_;
    uint32_t equipmentID2_;
    uint8_t eqNum_;
    uint8_t result_;
    uint8_t endSet_;
    uint8_t packNum_;
    uint8_t bcchCnt_;
    std::vector<XML_SCAN_BCCH_INFO> bcchRecord_;
};

class MSG_GPSINFO_REQ
{
public:
    MSG_GPSINFO_REQ();

    uint32_t btsId_;
    int8_t cpuUtil_;
    int8_t memUtil_;
    int8_t sdUtil_;
    int8_t temp_;
    int8_t powerStat_;
    int8_t g3CardStat_;
    int8_t wifiStat_;
    int8_t paSata;
    int8_t att_;
    int8_t paOut_;
    uint32_t uiYear_;
    uint32_t uiMounth_;
    uint32_t uiDayOfWeek;
    uint32_t uiDay_;
    uint32_t uiHour_;
    uint32_t uiMinute_;
    uint32_t uiSecond_;
    uint32_t uiMilliseconds_;
    int8_t status_;
    double lat_;
    int8_t latHemi_;
    double long_;
    int8_t longHemi_;
    double speed_;
    double course_;
    double magDeg;
    int8_t dierction;
};

#endif
